package com.vodone.v1pin.common.delegate
{
	import com.vodone.v1pin.common.vo.BrandVO;
	
	public class BrandConvertUtil
	{
		public static function getBrandList( obj:Object ):Array
		{
			var list:Array = [];
			var level:int = 0;
			if( obj.hasOwnProperty("data") )
			{
				var arr:Array = obj["data"];
				var len:int = arr.length;
				for( var i:int = 0 ; i < len ; i++ ){
					list.push( getBrand( arr[i] ) );
				}
			}
			
			return list;
		}
		
		public static function getBrand( obj:Object ):BrandVO
		{
			var vo:BrandVO = new BrandVO();
			if( obj.hasOwnProperty("id") )
			{
				vo.name = obj["name"];
			}
			if( obj.hasOwnProperty("id") )
			{
				vo.id = obj["id"];
			}
			if( obj.hasOwnProperty("discripte") )
			{
				vo.discripte = obj["discripte"];
			}
			if( obj.hasOwnProperty("type") )
			{
				vo.type = obj["type"];
			}
			return vo;
		}
	}
}